package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.interfaces.IDynamicTemplate;
import com.ruoyi.common.core.interfaces.imple.DynamicTemplateImpl;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Classname SysCommonController
 * @Author: sunluquan
 * @Date: 2022/6/30 16:43
 * @Description TODO
 */
@RequestMapping("/system/common")
@Controller
public class SysCommonController {

    private String prefix = "system/common";

    /**
     * 跳转到动态模板展示页面
     * @param modelMap
     * @return
     */
    @GetMapping("/dynamicTemplate")
    public String toDynamicTemplate(ModelMap modelMap){

        final String TEMPLATE_KEY = IDynamicTemplate.KEY;

        Object data = modelMap.get(TEMPLATE_KEY);

        if(StringUtils.isNull(data)){
            //modelMap.put(TEMPLATE_KEY,new DynamicTemplateImpl());
        }

        return prefix + "/dynamicTemplate";
    }
}
